<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>店铺库息报表</title>
<script type="text/javascript" src="/fuman/js/product.js"></script>


<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent tables">
  <div class="pageheader notab">
    <h1 class="pagetitle">店铺库息报表</h1>
    
  <span class="pagedesc">
  	FBA库息计算说明：<br>
   	&nbsp;&nbsp;&nbsp;&nbsp;1、库存从4月1号开始记录;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;2、入库：FBA以亚马逊后台Shipment签收入库为时间起始点。<a href="/order/fulflllment" target="_blank"><font color="#0000FF">查看入库记录</font></a><br>
    &nbsp;&nbsp;&nbsp;&nbsp;3、出库：出库时间以系统抓取到的FBA订单时间为准，遵循先进先出原则。<a href="/order/amazonfba" target="_blank"><font color="#0000FF">查看FBA订单</font></a><br>
     &nbsp;&nbsp;&nbsp;&nbsp;4、计算：签收日起60天内不计算任何库息。60天后按每天千分之3累积库息。<br>
  <br>
  </span>
    <div class="menulist">
    
  </div>
     </div>
  <!--pageheader-->
     <div>
   		<div style="float:left">{{if $managers || in_array('286',$showpower)}}  &nbsp;&nbsp; <a href="javascript:void(0)" onClick="savesettlement()" class="btn btn2 btn_help"><span>确认结算</span>
        </a>
       
       
        {{/if}} 
        </div>
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
  <div id="contentwrapper" class="contentwrapper"> 
    <!--搜索栏-->
    <form class="stdform stdform2"  method="get" action="/datareport/interest">
      <div class="tableoptions">  
        关键词 <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
        库息大于 <input type="text" name="int_value" id="int_value" class="width100" value="{{$int_value}}" />
         <span id="search_list">{{$shopname|getstr:48:0}}</span>
       <input name="shopname" id="shopname" type="hidden" value="{{$shopname}}" />
       <span id="choose_shop_btn" style="border:1px solid #ccc;padding:6px 5px 7px;border-radius:3px;cursor:pointer;" onClick="getShopList()">选择店铺 <img src="/fuman/images/search_down.png" width="14" height="21" align="absmiddle" style="margin-bottom:-4px;"></span>
        <button class="btn btn_orange btn_search radius50">Search</button>
        	&nbsp;&nbsp;&nbsp;<span id="allcount"></span>
      </div>
    </form>
    <!--搜索栏结束-->
    
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
      <colgroup>
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      </colgroup>
      <thead>
        <tr>
          <th class="head0"><a onClick="allSelect('ppid[]')">全选</a></th>
         
          <th class="head0">商品编号</th>
          <th class="head1">商品名称</th>
          <th class="head0">开始时间</th>
          <th class="head1">店铺 </th>
          <th class="head1">库息 </th>
          <th class="head1">结算时间</th>
          <th class="head1">累积结算</th>
        </tr>
      </thead>
      <tbody>
      
      {{foreach from=$list item=li key=key}}
      <tr>
        <td><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}"  /></td>
        <td><a href="/product/productlist?other={{$li.goods_sku}}" target="_blank">{{$li.goods_sku}}</a></td>
        <td>
      	
        {{$li.goods_name}}</td>
        <td>{{$li.starttime}}</td>
        <td class="center">{{$li.shopname}}</td>
    <td class="center">{{$li.interest}}</td>
     <td class="center">{{$li.settlement}}</td>
      <td class="center">{{$li.interest_allnum}}</td>
      </tr>
      {{/foreach}}
      
    </table>
    <div class="page">{{$pageList}}</div>
    <br />
    <br />
  </div>
</div>
<!--bodywrapper-->
<div style="position:absolute;z-index:999;top:105px;border:1px solid #666;left:220px;width:870px;background:#f5f5f5;padding:6px 10px;height:450px;margin-bottom:40px;display:none;" id="ajax_box">
<div style="padding-top:8px;padding-left:12px;height:28px;"><h4 style="float:left">选择1要搜索的店铺</h4><span style="float:right">
  <input type="button" name="button" id="button" onClick="setShopInfo()" value="确定选择">&nbsp;&nbsp;
  <input type="button" value="关闭弹层" onClick="closeShowBox()">
</span></div>
<div id="shop_box" style="height:400px;overflow:auto"></div>
</div>
<script type="text/javascript" src="/fuman/js/report.js"></script>

<!-- 模态框（Modal） 结算-->
<form action="/datareport/ajaxbutton?op=savesettlement"  method="post" name="uctform" id="uctform" >
<input type="hidden" name="haltsalessku" id="haltsalessku">
  <div class="modal fade" id="MergeProductform" tabindex="-1" role="dialog" aria-labelledby="sMergeProductform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sMergeProductform">确认结算 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
              <td style="line-height:25px;">
              按搜索条件结算当前库息。结算数据如下： <br>
             	<span id="showshopname"></span><br>
                <span id="showallcount"></span>
              <br>
              
              
             
             </td>
            </tr>
            
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctform','MergeProductform')"> 提交 </button>
<!--            <button type="submit" name="spa">保存</button>
-->          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）合并商品 -->
<script>
getalldata();
function getalldata()
{
	var other = $("#other").val();
	var int_value   = $("#int_value").val();
	var shopname	  = $("#shopname").val();
	
 $.post("/datareport/ajaxbutton", {"op": "getinterest","other":other,"int_value":int_value,"shopname":shopname},
	  function(data){
			$("#allcount").html("<font color=red>合计未结算库息："+data+" (RMB)</font>");
	  },"json");
}
function savesettlement()
{
	$("#showshopname").html("结算店铺："+$("#shopname").val());
	$("#showallcount").html("结算金额："+$("#allcount").html());
	$("#haltsalessku").val($("#shopname").val());
	$('#MergeProductform').modal('show');	
}
</script>
</body>
</html>